import axios from '@/utils/axios';
// 获取主题装修第一页-即编辑按钮
export const getDefaultPageParams = (id) => {
    return axios.request({
        url: `/site/decoration/${id}`,
        method: 'get'
    });
};

// 获取可添加卡片列表
export const getCards = (id) => {
    return axios.request({
        url: '/site/decoration/card',
        method: 'get'
    });
};

// 添加站点卡片
export const addSiteCard = (data) => {
    return axios.request({
        url: '/site/decoration/card',
        method: 'post',
        data
    });
};

// 编辑站点卡片
export const editSiteCard = (data) => {
    return axios.request({
        url: '/site/decoration/card',
        method: 'put',
        data
    });
};

// 重置卡片
export const resetSiteCard = (id) => {
    return axios.request({
        url: `/site/decoration/card/reset/${id}`,
        method: 'put'
    });
};

// 更改卡片排序接口
export const sortSiteCard = (data) => {
    return axios.request({
        url: '/site/decoration/card/sort',
        method: 'put',
        data
    });
};

// 删除卡片接口
export const deleteSiteCard = (id) => {
    return axios.request({
        url: `/site/decoration/card/${id}`,
        method: 'delete'
    });
};

// 获取全局卡片列表
export const getGlobalCards = (id) => {
    return axios.request({
        url: `/site/decoration/global-card/${id}`,
        method: 'get'
    });
};

// 新增自定义页面
export const addCustomPage = (data) => {
    return axios.request({
        url: '/site/decoration/page',
        method: 'post',
        data
    });
};

// 发布
export const publishSite = (siteId) => {
    return axios.request({
        url: `/site/decoration/publish/${siteId}`,
        method: 'put'
    });
};

// 字体
export const commonFont = () => {
    return axios.request({
        url: '/site/decoration/font',
        method: 'get'
    });
};

// 删除自定义页面
export const delCustomPage = (id) => {
    return axios.request({
        url: `/site/decoration/page/${id}`,
        method: 'delete'
    });
};

// 获取主题自定义列表
export const getThemePage = (params) => {
    return axios.request({
        url: '/site/decoration/theme-page',
        method: 'get',
        params
    });
};
